package com.wesley.spring.aop;

import com.wesley.spring.proxy.biz.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@ComponentScan(basePackages = {"com.wesley.spring"})
@EnableAspectJAutoProxy
public class AopEntrance {

    public static void main(String[] args) {
    	AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
		ctx.register(AopEntrance.class);
		ctx.refresh();

		UserService userService = ctx.getBean("userService", UserService.class);
		userService.name();
        /*
         ProgramCalculate pcalculate = (ProgramCalculate) ctx.getBean("tulingCalculate");
        System.out.println(pcalculate.toBinary(100));
        */
    }

}
